package thread;

public class Demo18 {
    public class counter {
        int count = 0;
        
        synchronized void add( ) {//这里对象省略了this
            count++;
        }
        public void add1( ) {
            synchronized(this){
                synchronized (this) {
                    count++;
            }
            }
            
        }
        synchronized public static void add2(){

        }
        public static void add3(){
            synchronized (counter.class) {
                
            }
        }
    }
}
